#include <bits/stdc++.h>
using namespace std;
const long long MOD = (long long)1e9 + 7;
const long double PI = 3.141592653589793238462643383279502884197;
priority_queue<int, vector<int>, greater<int> > pq;
vector<int> v;
int vec[300000];
int dp[300000][19];
int last[19];
int main() {
  memset(last, -1, sizeof(last));
  memset(dp, -1, sizeof(dp));
  int n, q;
  scanf("%d %d", &n, &q);
  for (int i = 0; i < n; i++) {
    scanf("%d", &vec[i]);
    for (int j = 0; j < 19; j++) {
      if (vec[i] & (1 << j)) {
        dp[i][j] = i;
        if (last[j] != -1) {
          for (int k = 0; k < 19; k++) dp[i][k] = max(dp[i][k], dp[last[j]][k]);
        }
        last[j] = i;
      }
    }
  }
  while (q--) {
    int a, b;
    scanf("%d %d", &a, &b);
    a--;
    b--;
    int flag = 0;
    for (int i = 0; i < 19; i++)
      if ((vec[a] & (1 << i)) && dp[b][i] >= a) {
        flag = 1;
        break;
      }
    if (flag)
      printf("Shi\n");
    else
      printf("Fou\n");
  }
}
