#include <bits/stdc++.h>
using namespace std;
int n, q;
int a[300010], dp[300010][25], last[25];
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  memset(dp, 0x3f, sizeof(dp));
  for (int i = n; i >= 1; i--) {
    for (int j = 0; j < 20; j++) {
      if (a[i] & (1 << j))
        dp[i][j] = i;
      else {
        for (int k = 0; k < 20; k++) {
          if ((a[i] & (1 << k)) && last[k]) {
            dp[i][j] = min(dp[i][j], dp[last[k]][j]);
          }
        }
      }
    }
    for (int j = 0; j < 20; j++) {
      if (a[i] & (1 << j)) last[j] = i;
    }
  }
  while (q--) {
    int x, y;
    scanf("%d%d", &x, &y);
    int flag = 0;
    for (int i = 0; i <= 20; i++) {
      if (a[y] & (1 << i) && dp[x][i] <= y) {
        flag = 1;
        break;
      }
    }
    if (flag)
      puts("Shi");
    else
      puts("Fou");
  }
}
